import { computed } from 'vue'
import { useI18n } from 'vue-i18n'
import { FormItemType } from '@/types/component/form'
import type { FormItemConfig } from '@/types/component/form'

/**
 * 获取重置密码表单配置项
 * @param username 用户名，用于显示在表单中
 * @returns 重置密码表单配置项
 */
export const useResetPasswordFormItems = (username?: string) => {
  const { t } = useI18n()
  
  return computed<FormItemConfig[]>(() => [
    {
      field: 'username',
      label: t('user.username'),
      type: FormItemType.INPUT,
      disabled: true,
      value: username
    },
    {
      field: 'newPassword',
      label: t('user.newPassword'),
      type: FormItemType.INPUT_PASSWORD,
      placeholder: t('user.newPasswordPlaceholder')
    },
    {
      field: 'confirmPassword',
      label: t('user.confirmPassword'),
      type: FormItemType.INPUT_PASSWORD,
      placeholder: t('user.confirmPasswordPlaceholder')
    }
  ])
} 